package com.powernode.utils;

import cn.hutool.crypto.SecureUtil;
import com.powernode.common.Result;
import com.powernode.controller.LoginController;
import com.powernode.domain.User;
import com.powernode.dto.UserDto;
import com.powernode.mapper.UserMapper;
import com.powernode.service.UserService;
import com.powernode.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;
import java.util.List;

public class MD5Utils {

    public static String md5(String source){
        return SecureUtil.md5(source);
    }

    public static String md5ForSpring(String source){
        return DigestUtils.md5DigestAsHex(source.getBytes(StandardCharsets.UTF_8));
    }

}
